package com.jvyou.mybatis.builder.tags;

import com.jvyou.mybatis.session.Configuration;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.dom4j.Element;

/**
 * @author 橘柚
 * @version 1.0-SNAPSHOT
 * @Date 2024/7/8 18:22
 * @Description 事务管理器相关配置
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Deprecated
public class TransactionNode implements XmlConfigNode {
    /*事务管理器的类型*/
    private String type;

    /*事务管理器节点*/
    private Element element;

    public TransactionNode(Element element) {
        this.element = element;
    }

    @Override
    public Configuration apply(Configuration configuration) {
        this.type = element.attributeValue("type").trim();
        return configuration;
    }
}
